<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h3>鼠标事件</h3>
    <p>监听与鼠标相关的操作</p>
    <hr>
    <div class="box" style="height: 200px;"></div>

    <script>
        const box = document.querySelector('.box');
        box.addEventListener('mouseenter', function () {
            this.innerText = '鼠标移入了...';
            this.style.cursor = 'move';
        })
        box.addEventListener('mouseleave', function () {
            this.innerText = '鼠标移出了...'
        })
    </script>
</body>

</html>